package la.iok.hzsvn.lewin.movie.cloud.entity;

import la.iok.hzsvn.lewin.movie.core.RoleEnum;
import la.iok.hzsvn.share.collection.IdAble;

/**
 * 用户角色
 */
public class Role implements IdAble<Long> {
    private Long id;
    /**
     * 角色名称
     */
    private String name;

    public Role() {
    }

    public Role(String name) {
        this.name = name;
    }

    public Role(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    @Override
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 是否超级管理员角色
     * @return 是返回true不是返回false
     */
    public boolean admin(){
        return RoleEnum.Admin.name().equals(name);
    }
}
